const tokenKey = "USER_TOKEN";

// 设置token
export function setToken(value) {
  return uni.setStorageSync(tokenKey, value);
}
// 获得token
export function getToken() {
  return uni.getStorageSync(tokenKey);
}
// 删除token
export function removeToken() {
  return uni.removeStorageSync(tokenKey);
}

// 设置储存
export function setKey(key, value) {
  return uni.setStorageSync(key, value);
}
// 获得储存
export function getKey(key) {
  return uni.getStorageSync(key);
}
// 删除储存
export function removeKey(key) {
  return uni.removeStorageSync(key);
}

// 定义成功提示
export function toast(title, icon = "none", duration = 1000) {
  return uni.showToast({
    title,
    icon,
    duration,
  });
}
